package com.rover.entity.system;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.common.Common;
import com.grid.ViewField;

/**
 * 用户.
 *
 */
@Entity
@Table(name = "S_Users")
public class User  implements Serializable {
    private static final long serialVersionUID = -6692220655220951663L;

    private Long id;
    @ViewField(header = "登录名", width = 150)
    private String loginName;
    @ViewField
    private String password;
    @ViewField(header = "姓名", width = 200)
    private String name;
  
    private int status = Common.ENABLE_STATUS;//默认为启用状态
    @ViewField(header = "状态", width = 150)
    private String statusList;
    
    @ViewField(header = "邮箱", width = 250)
    private String email;
    @ViewField(header = "角色", width = 200)
    private String rolesName;
    @ViewField
    private String rolesId;

    
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY) 
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }

    @Column(nullable = false, unique = true, length = 20)
    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    @Column(length = 50)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(length = 50)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Column(length = 10)
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }
    
    @Transient
    public String getStatusList() {
		return statusList;
	}

	public void setStatusList(String statusList) {
		this.statusList = statusList;
	}

	public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Transient
    public String getUserName() {
        return name.equals("") ? loginName : name;
    }

	public void setRolesName(String rolesName) {
		this.rolesName = rolesName;
	}
	@Transient
	public String getRolesName() {
		return rolesName;
	}

	public void setRolesId(String rolesId) {
		this.rolesId = rolesId;
	}
	@Transient
	public String getRolesId() {
		return rolesId;
	}

 
	



}
